package org.gen.util;

import org.gen.config.GenConfig;

import java.io.InputStream;

/**
 *
 * @author 朱良才
 * @Email zhuliangcai@itcast.com
 * @Date 2017-10-16
 */
public class MavenModuleUtil {
    public static String getModuleRootPath(){
        String path = MavenModuleUtil.class.getResource(".").getPath();
        return path.substring(0,path.indexOf("target"));
    }
    public static void main(String[] args) {
        InputStream inputStream =
                GenConfig.class.getResourceAsStream("/properties/config.properties");
        System.out.println(inputStream);
        String path = MavenModuleUtil.getModuleRootPath();
        System.out.println(path);
        System.out.println(System.getProperty("user.dir"));
        // 获得项目根目录的绝对路径
        System.out.println(System.getProperty("java.class.path")) ;   //得到类路径和包路径
    }

}
